package main

import "fmt"

func numWaterBottles(numBottles int, numExchange int) int {
	var sum int = numBottles
	for numBottles >= numExchange {
		sum++
		numBottles -= numExchange
		numBottles++
	}
	return sum
}

func main() {
	fmt.Println(numWaterBottles(9, 3))
}
